{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.7.0+24.gf2bf6ab.dirty\n"
     ]
    }
   ],
   "source": [
    "import os\n",
    "import folium\n",
    "\n",
    "print(folium.__version__)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div style=\"width:100%;\"><div style=\"position:relative;width:100%;height:0;padding-bottom:60%;\"><iframe src=\"data:text/html;charset=utf-8;base64,PCFET0NUWVBFIGh0bWw+CjxoZWFkPiAgICAKICAgIDxtZXRhIGh0dHAtZXF1aXY9ImNvbnRlbnQtdHlwZSIgY29udGVudD0idGV4dC9odG1sOyBjaGFyc2V0PVVURi04IiAvPgogICAgPHNjcmlwdD5MX1BSRUZFUl9DQU5WQVM9ZmFsc2U7IExfTk9fVE9VQ0g9ZmFsc2U7IExfRElTQUJMRV8zRD1mYWxzZTs8L3NjcmlwdD4KICAgIDxzY3JpcHQgc3JjPSJodHRwczovL2Nkbi5qc2RlbGl2ci5uZXQvbnBtL2xlYWZsZXRAMS4zLjQvZGlzdC9sZWFmbGV0LmpzIj48L3NjcmlwdD4KICAgIDxzY3JpcHQgc3JjPSJodHRwczovL2FqYXguZ29vZ2xlYXBpcy5jb20vYWpheC9saWJzL2pxdWVyeS8xLjExLjEvanF1ZXJ5Lm1pbi5qcyI+PC9zY3JpcHQ+CiAgICA8c2NyaXB0IHNyYz0iaHR0cHM6Ly9tYXhjZG4uYm9vdHN0cmFwY2RuLmNvbS9ib290c3RyYXAvMy4yLjAvanMvYm9vdHN0cmFwLm1pbi5qcyI+PC9zY3JpcHQ+CiAgICA8c2NyaXB0IHNyYz0iaHR0cHM6Ly9jZG5qcy5jbG91ZGZsYXJlLmNvbS9hamF4L2xpYnMvTGVhZmxldC5hd2Vzb21lLW1hcmtlcnMvMi4wLjIvbGVhZmxldC5hd2Vzb21lLW1h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csIC00MS4zMzgwNTU1NTU1NTU1NTZdLAogICAgICAgIHpvb206IDYsCiAgICAgICAgbWF4Qm91bmRzOiBib3VuZHMsCiAgICAgICAgbGF5ZXJzOiBbXSwKICAgICAgICB3b3JsZENvcHlKdW1wOiBmYWxzZSwKICAgICAgICBjcnM6IEwuQ1JTLkVQU0czODU3LAogICAgICAgIHpvb21Db250cm9sOiB0cnVlLAogICAgICAgIH0pOwoKCiAgICAKICAgIHZhciB0aWxlX2xheWVyXzcyYTgzOTI5YTZjMzQwNzRiMjg4NmNjZmNkZTk3M2U0ID0gTC50aWxlTGF5ZXIoCiAgICAgICAgJ2h0dHBzOi8ve3N9LnRpbGUub3BlbnN0cmVldG1hcC5vcmcve3p9L3t4fS97eX0ucG5nJywKICAgICAgICB7CiAgICAgICAgImF0dHJpYnV0aW9uIjogbnVsbCwKICAgICAgICAiZGV0ZWN0UmV0aW5hIjogZmFsc2UsCiAgICAgICAgIm1heE5hdGl2ZVpvb20iOiAxOCwKICAgICAgICAibWF4Wm9vbSI6IDE4LAogICAgICAgICJtaW5ab29tIjogMCwKICAgICAgICAibm9XcmFwIjogZmFsc2UsCiAgICAgICAgIm9wYWNpdHkiOiAxLAogICAgICAgICJzdWJkb21haW5zIjogImFiYyIsCiAgICAgICAgInRtcyI6IGZhbHNlCn0pLmFkZFRvKG1hcF8zNWY0NWU2ZDY4YzQ0MTk2OWYyODRmMGUxMjlhZDBlMCk7CiAgICAKICAgICAgICAgICAgdmFyIGNpcmNsZV9tYXJrZXJfOGFmNjc4NTcxZjY3NDY4MzgyM2Y0NmYwODM3NGUyMGUgPSBMLmNpcmNsZU1hcmtlcigKICAgICAgICAgICAgICAgIFstMTUsIC00NV0sCiAgICAgICAgICAgICAgICB7CiAgImJ1YmJsaW5nTW91c2VFdmVudHMiOiB0cnVlLAogICJjb2xvciI6ICJibGFjayIsCiAgImRhc2hBcnJheSI6IG51bGwsCiAgImRhc2hPZmZzZXQiOiBudWxsLAogICJmaWxsIjogdHJ1ZSwKICAiZmlsbENvbG9yIjogImdyZWVuIiwKICAiZmlsbE9wYWNpdHkiOiAxLAogICJmaWxsUnVsZSI6ICJldmVub2RkIiwKICAibGluZUNhcCI6ICJyb3VuZCIsCiAgImxpbmVKb2luIjogInJvdW5kIiwKICAib3BhY2l0eSI6IDEuMCwKICAicmFkaXVzIjogMTAsCiAgInN0cm9rZSI6IHRydWUsCiAgIndlaWdodCI6IDEKfQogICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgLmFkZFRvKG1hcF8zNWY0NWU2ZDY4YzQ0MTk2OWYyODRmMGUxMjlhZDBlMCk7CiAgICAgICAgICAgIAogICAgCiAgICAgICAgY2lyY2xlX21hcmtlcl84YWY2Nzg1NzFmNjc0NjgzODIzZjQ2ZjA4Mzc0ZTIwZS5iaW5kVG9vbHRpcCgKICAgICAgICAgICAgYDxkaXY+YAogICAgICAgICAgICArIGBVcHBlciBMZWZ0IENvcm5lcmAgKyBgPC9kaXY+YCwKICAgICAgICAgICAgeyJzdGlja3kiOiB0cnVlfQogICAgICAgICk7CiAgICAgICAgCiAgICAKICAgICAgICAgICAgdmFyIGNpcmNsZV9tYXJrZXJfZmNjYmZmNzE0NzEyNDQ3NGE2NzA0NzFhNjFkOWYxMDcgPSBMLmNpcmNsZU1hcmtlcigKICAgICAgICAgICAgICAgIFstMjUsIC00NV0sCiAgICAgICAgICAgICAgICB7CiAgImJ1YmJsaW5nTW91c2VFdmVudHMiOiB0cnVlLAogICJjb2xvciI6ICJibGFjayIsCiAgImRhc2hBcnJheSI6IG51bGwsCiAgImRhc2hPZmZzZXQiOiBudWxsLAogICJmaWxsIjogdHJ1ZSwKICAiZmlsbENvbG9yIjogImdyZWVuIiwKICAiZmlsbE9wYWNpdHkiOiAxLAogICJmaWxsUnVsZSI6ICJldmVub2RkIiwKICAibGluZUNhcCI6ICJyb3VuZCIsCiAgImxpbmVKb2luIjogInJvdW5kIiwKICAib3BhY2l0eSI6IDEuMCwKICAicmFkaXVzIjogMTAsCiAgInN0cm9rZSI6IHRydWUsCiAgIndlaWdodCI6IDEKfQogICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgLmFkZFRvKG1hcF8zNWY0NWU2ZDY4YzQ0MTk2OWYyODRmMGUxMjlhZDBlMCk7CiAgICAgICAgICAgIAogICAgCiAgICAgICAgY2lyY2xlX21hcmtlcl9mY2NiZmY3MTQ3MTI0NDc0YTY3MDQ3MWE2MWQ5ZjEwNy5iaW5kVG9vbHRpcCgKICAgICAgICAgICAgYDxkaXY+YAogICAgICAgICAgICArIGBMb3dlciBMZWZ0IENvcm5lcmAgKyBgPC9kaXY+YCwKICAgICAgICAgICAgeyJzdGlja3kiOiB0cnVlfQogICAgICAgICk7CiAgICAgICAgCiAgICAKICAgICAgICAgICAgdmFyIGNpcmNsZV9tYXJrZXJfNTg3MDRlOTNhOTgxNGVlYTk0MmYzNjBiODZmMjc4MjEgPSBMLmNpcmNsZU1hcmtlcigKICAgICAgICAgICAgICAgIFstMjUsIC0zNV0sCiAgICAgICAgICAgICAgICB7CiAgImJ1YmJsaW5nTW91c2VFdmVudHMiOiB0cnVlLAogICJjb2xvciI6ICJibGFjayIsCiAgImRhc2hBcnJheSI6IG51bGwsCiAgImRhc2hPZmZzZXQiOiBudWxsLAogICJmaWxsIjogdHJ1ZSwKICAiZmlsbENvbG9yIjogImdyZWVuIiwKICAiZmlsbE9wYWNpdHkiOiAxLAogICJmaWxsUnVsZSI6ICJldmVub2RkIiwKICAibGluZUNhcCI6ICJyb3VuZCIsCiAgImxpbmVKb2luIjogInJvdW5kIiwKICAib3BhY2l0eSI6IDEuMCwKICAicmFkaXVzIjogMTAsCiAgInN0cm9rZSI6IHRydWUsCiAgIndlaWdodCI6IDEKfQogICAgICAgICAgICAgICAgKQogICAgICAgICAgICAgICAgLmFkZFRvKG1hcF8zNWY0NWU2ZDY4YzQ0MTk2OWYyODRmMGUxMjlhZDBlMCk7CiAgICAgICAgICAgIAogICAgCiAgICAgICAgY2lyY2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0aWNreSI6IHRydWV9CiAgICAgICAgKTsKICAgICAgICAKPC9zY3JpcHQ+\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;border:none !important;\" allowfullscreen webkitallowfullscreen mozallowfullscreen></iframe></div></div>"
      ],
      "text/plain": [
       "<folium.folium.Map at 0x7fa798cfeac8>"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "lon = -(41 + 20/60. + 17/60/60.)\n",
    "lat = -(20 + 59/60. + 35/60/60.)\n",
    "\n",
    "min_lon, max_lon = -45, -35\n",
    "min_lat, max_lat = -25, -15\n",
    "\n",
    "m = folium.Map(\n",
    "    max_bounds=True,\n",
    "    location=[lat, lon],\n",
    "    zoom_start=6,\n",
    "    min_lat=min_lat,\n",
    "    max_lat=max_lat,\n",
    "    min_lon=min_lon,\n",
    "    max_lon=max_lon\n",
    ")\n",
    "\n",
    "\n",
    "kw = {\n",
    "    'radius': 10,\n",
    "    'color': 'black',\n",
    "    'fill': True,\n",
    "    'weight': 1,\n",
    "    'fill_color': 'green',\n",
    "    'fill_opacity': 1\n",
    "}\n",
    "\n",
    "c0 = folium.CircleMarker(location=[max_lat, min_lon], tooltip='Upper Left Corner', **kw)\n",
    "c1 = folium.CircleMarker(location=[min_lat, min_lon], tooltip='Lower Left Corner', **kw)\n",
    "c2 = folium.CircleMarker(location=[min_lat, max_lon], tooltip='Lower Right Corner', **kw)\n",
    "c3 = folium.CircleMarker(location=[max_lat, max_lon], tooltip='Upper Right Corner', **kw)\n",
    "\n",
    "for c in [c0, c1, c2, c3]:\n",
    "    m.add_child(c)\n",
    "\n",
    "m.save(os.path.join('results', 'MinMaxLimits.html'))\n",
    "\n",
    "m"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 1
}
